package com.apes.fn.scm.retailOrder.repository;

import com.apes.fn.scm.retailOrder.model.RetailOrderDiscount;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author HuJianlin
 * @create 2018-10-31 16:07
 */
public interface RetailOrderDiscountRepository extends CustomRepository<RetailOrderDiscount, String> {

    List<RetailOrderDiscount> findAllByRetailOrderId(String retailOrderId);

    @Query("SELECT T FROM RetailOrderDiscount T WHERE T.retailOrderItem.id = :id")
    RetailOrderDiscount findByRetailOrderItemId(@Param("id") String id);

}
